package cmm.Seman;

/**
 * Created by Iray on 2017/12/1.
 */
public class Symbol {

    public static final int TEMP = -1;
    public final static int INT = 0;
    public final static int REAL = 1;
    public final static int INTL = 2;
    public final static int REALL = 3;

    public final static int TRUE = 4;
    public final static int FALSE = 5;

    private String name;
    private int type;
    private Value value;
    private int line;
    private int position;
    private Symbol sameName;
    private int level;
    private int listSize;
    public Symbol(String name, int type, int level) {
        this.name = name;
        this.type = type;
        this.level = level;

        this.value = new Value(type);
    }
    public Symbol(String name, int type, int level, int size) {
        this.name = name;
        this.type = type;
        this.level = level;
        this.listSize = size;

        this.value = new Value(type);
    }

    public Symbol(String name, int type, int level, Value value) {
        this.name = name;
        this.type = type;
        this.level = level;
        this.value = value;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public Value getValue() {
        return value;
    }

    public void setValue(Value value) {
        this.value = value;
    }

    public int getLine() {
        return line;
    }

    public void setLine(int line) {
        this.line = line;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public Symbol getSameName() {
        return sameName;
    }

    public void setSameName(Symbol sameName) {
        this.sameName = sameName;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
